@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');

body {
  background: linear-gradient(120deg, #e0e7ff 0%, #f1f5f9 100%);
  font-family: 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
  color: #222;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.container {
  margin-top: 40px;
  padding-bottom: 40px;
}

.panel {
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(80,120,200,0.10);
  border: none;
  background: #fff;
  margin-bottom: 24px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.panel:hover {
  box-shadow: 0 8px 32px rgba(80,120,200,0.16);
  transform: translateY(-2px);
}

.panel-primary > .panel-heading {
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, #4f8cff 0%, #2563eb 100%);
  color: #fff;
  padding: 16px 24px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 1px;
}

.panel-title {
  font-weight: 600;
  font-size: 17px;
}

.list-group-item {
  border: none;
  border-radius: 10px;
  margin: 8px 0;
  padding: 12px 18px;
  background: #f7faff;
  color: #222;
  font-size: 15px;
  transition: background 0.2s, color 0.2s;
}

.list-group-item:hover {
  background: #e0e7ff;
  color: #2563eb;
}

.btn-primary {
  background: linear-gradient(90deg, #4f8cff 0%, #2563eb 100%);
  border: none;
  border-radius: 10px;
  font-weight: 500;
  padding: 10px 0;
  width: 100px;
  box-shadow: 0 2px 8px rgba(80,120,200,0.10);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
  font-size: 15px;
}

.btn-primary:hover {
  background: linear-gradient(90deg, #2563eb 0%, #4f8cff 100%);
  box-shadow: 0 4px 16px rgba(80,120,200,0.16);
  transform: translateY(-1px);
}

#log-container {
  background: #f7faff;
  border-radius: 14px;
  padding: 18px 16px;
  height: 400px;
  overflow-y: scroll;
  border: none;
  box-shadow: inset 0 1px 6px rgba(80,120,200,0.06);
  margin-bottom: 12px;
}

.bg-info, .bg-success {
  border-radius: 14px;
  padding: 10px 18px;
  margin-bottom: 10px;
  display: inline-block;
  max-width: 80%;
  word-break: break-word;
  font-size: 15px;
  box-shadow: 0 1px 4px rgba(80,120,200,0.07);
}

.bg-info {
  background: #e0e7ff;
  color: #222;
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

.bg-success {
  background: #4f8cff;
  color: #fff;
  margin-left: 20%;
  border-bottom-right-radius: 4px;
}

.message-time {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 4px;
}

.input-group {
  position: relative;
  margin-top: 20px;
}

#myinfo, #msg {
  border-radius: 10px;
  border: 2px solid #e0e7ff;
  padding: 12px 16px;
  font-size: 15px;
  background: #fff;
  margin-bottom: 8px;
  transition: border 0.2s, box-shadow 0.2s;
}

#myinfo:focus, #msg:focus {
  border-color: #4f8cff;
  box-shadow: 0 0 0 2px #4f8cff22;
  outline: none;
}

.emoji-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  transition: color 0.2s ease;
  z-index: 2;
}

.emoji-btn:hover {
  color: #4f8cff;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c7d2fe;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a5b4fc;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .container {
    margin-top: 10px;
    padding: 0 4px;
  }
  
  .panel {
    border-radius: 12px;
    margin-bottom: 10px;
  }
  
  #log-container {
    height: 220px;
    padding: 8px 4px;
  }
  
  .bg-info, .bg-success {
    max-width: 95%;
    font-size: 14px;
  }
  
  .panel-title {
    font-size: 15px;
  }
}

/* 聊天气泡对齐优化 */
.message-row {
  display: flex;
  width: 100%;
  margin-bottom: 10px;
}
.message-row.self {
  justify-content: flex-end;
}
.message-row.other {
  justify-content: flex-start;
}
.message-row.system {
  justify-content: center;
}
.bubble-self {
  background: #4f8cff;
  color: #fff;
  border-radius: 18px 18px 4px 18px;
  padding: 12px 22px;
  max-width: 70%;
  box-shadow: 0 2px 8px rgba(80,120,200,0.13);
  text-align: left;
  margin-left: auto;
  margin-right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 16px;
}
.bubble-self .message-time {
  color: #e0e7ff;
  font-size: 13px;
  margin-bottom: 4px;
  align-self: flex-end;
}
.bubble-other {
  background: #e0e7ff;
  color: #222;
  border-radius: 18px 18px 18px 4px;
  padding: 12px 22px;
  max-width: 70%;
  box-shadow: 0 2px 8px rgba(80,120,200,0.13);
  text-align: left;
  margin-right: auto;
  margin-left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 16px;
}
.bubble-other .message-time {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 4px;
  align-self: flex-start;
}
.bubble-system {
  background: linear-gradient(90deg, #fffbe6 0%, #ffe58f 100%);
  color: #d48806;
  border-radius: 16px;
  padding: 12px 22px;
  max-width: 80%;
  font-weight: bold;
  box-shadow: 0 2px 8px #ffe58f99;
  text-align: center;
  border: 2px solid #ffe58f;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bubble-system::before {
  content: '\f0f3';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-right: 8px;
  color: #faad14;
  font-size: 18px;
}
.bubble-self.animate-fade-in-up,
.bubble-other.animate-fade-in-up,
.bubble-system.animate-pop-in {
  will-change: opacity, transform;
}
.btn-primary:active {
  animation: pulseBtn 0.3s;
}
.bubble-system-admin {
  background: linear-gradient(90deg, #ffe7ba 0%, #ffd666 100%);
  color: #ad6800;
  border-radius: 16px;
  padding: 14px 24px;
  max-width: 90%;
  font-weight: bold;
  box-shadow: 0 2px 8px #ffd66699;
  text-align: center;
  border: 2px solid #ffd666;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bubble-system-admin::before {
  content: '\f0a1';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-right: 8px;
  color: #fa8c16;
  font-size: 20px;
}
.bubble-broadcast {
  background: #fff7e6;
  border: 1px solid #ffe58f;
  color: #d48806;
  padding: 12px 16px;
  border-radius: 10px;
  margin: 10px 0;
  position: relative;
  animation: fadeIn 0.3s ease-in-out;
}
.bubble-broadcast::before {
  content: '📢';
  margin-right: 8px;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
#notice-bar marquee {
  font-size: 18px;
  font-weight: bold;
  color: #ad6800;
} 